<?php

if ($_COOKIE['wx_num'] === NULL && $_COOKIE['wx_nickname'] == NULL) {
    $resWechat = $wechatList[array_rand($wechatList)];
    $data['wx_num'] = $resWechat[0] ? $resWechat[0] : $_COOKIE['wechat_num'];
    $data['wx_nickname'] = $resWechat[1] ? $resWechat[1] : $_COOKIE['wx_nickname'];
    setcookie("wechat_num", $resWechat[0]);
    setcookie("wx_nickname", $resWechat[1]);
}else{
    $data['wx_num'] =  $_COOKIE['wechat_num'];
    $data['wx_nickname'] = $_COOKIE['wx_nickname'];
}

/*获取客户端ip*/
if (isset($_SERVER['HTTP_CLIENT_IP']) && strcasecmp($_SERVER['HTTP_CLIENT_IP'], "unknown"))
    $ip = $_SERVER['HTTP_CLIENT_IP'];
else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'], "unknown"))
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if (isset($_SERVER['REMOTE_ADDR']) && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
    $ip = $_SERVER['REMOTE_ADDR'];
else if (isset($_SERVER['REMOTE_ADDR']) && isset($_SERVER['REMOTE_ADDR']) && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
    $ip = $_SERVER['REMOTE_ADDR'];
else $ip = "";
//访问IP
$data['client_ip'] = $ip;
if($_GET['debug'] === 'kk'){
    echo "<h1>审核页</h1>";
    var_dump($data);
}
?>